<?php

// 创建连接
$conn = new mysqli("localhost", "root", "root", "xyq");
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}
$name = $_GET["name"];
$text = $_GET["text"];
$pwd = $_GET["pwd"];
$color = $_GET["color"];

$sql = "INSERT INTO `xyq` (name,text,password,color) VALUES ('$name','$text','$pwd','$color')";
if ($conn->query($sql) === TRUE) {
    //跳转到index.php
    header('Location: index.php');
} else {
    echo $conn->error;
}
?>